<div class="list">
  <table>
    <thead>
    <tr>

      <g:sortableColumn property="id" title="${message(code:'customer.table.id')}"/>

      <g:sortableColumn property="name" title="${message(code:'customer.table.name')}"/>

      <g:sortableColumn property="handPhone" title="${message(code:'customer.table.phone')}"/>

      <th>${message(code: 'customer.table.membership')}</th>

      <g:sortableColumn property="cardNumber" title="${message(code:'customer.table.cardNumber')}"/>

      <g:sortableColumn property="dob" title="${message(code:'customer.table.dob')}"/>

      <g:sortableColumn property="point" title="${message(code:'customer.table.point')}"/>

      <g:sortableColumn property="handPhone" title="${message(code:'customer.table.balance')}"/>

      <th/>

    </tr>
    </thead>
    <tbody>
    <g:each in="${customerInstanceList}" status="i" var="customerInstance">
      <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">

        <td><g:link action="show" id="${customerInstance.id}">${fieldValue(bean: customerInstance, field: 'id')}</g:link></td>

        <td>${fieldValue(bean: customerInstance, field: 'name')}</td>

        <td>${fieldValue(bean: customerInstance, field: 'handPhone')}</td>

        <td>${fieldValue(bean: customerInstance, field: 'membership')}</td>

        <td>${fieldValue(bean: customerInstance, field: 'cardNumber')}</td>

        <td><g:formatDate format="yyyy-MM-dd" date="${customerInstance.dob}"/></td>

        <td>${fieldValue(bean: customerInstance, field: 'point')}</td>

        <td>${fieldValue(bean: customerInstance, field: 'balance')}</td>

        <td>
          <g:link controller="job" params="['customer.id':customerInstance?.id]" action="create"><g:message code="customer.button.addjob"/></g:link>|
          <g:link controller="pay" params="['customer.id':customerInstance?.id]" action="create"><g:message code="customer.button.addpay"/></g:link>
        </td>

      </tr>
    </g:each>
    </tbody>
  </table>
</div>
<div class="paginateButtons">
  <g:paginate params="[query:lastQuery]" total="${total?total:0}"/>
</div>